home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 13
/
013.d81
/
dos #39
< prev
next >
Wrap
Text File
|
2022-08-26
|
4KB
|
217 lines
======================================
DOS & Don'ts -- Part 39
by James Gregory Weiler
======================================
Map 7: Side sector
byte description
---- ------------
0-1 Track & block of next side
sector.
1 If this is the last side
sector, byte of the last used
data block pointer.
2 Side sector number.
3 Record length.
4-5 Track/block of side sector 0.
6-7 Track/block of side sector 1.
8-9 Track/block of side sector 2.
10-11 Track/block of side sector 3.
12-13 Track/block of side sector 4.
14-15 Track/block of side sector 5.
16-255 Track/block links to 120
data blocks.
======================================
Bytes 0 and 1 of a side sector are
our old friends, links. They connect
each side sector to the next side
sector. If there is no next side
sector, then byte 0 contains a zero
and byte 1 contains the number of the
byte of the link to the last assigned
data block. (Don't despair, I'll
explain that gibberish.) What it
means in plain English is that if only
one data block has been used, byte one
will contain a value of 17. Byte 17
is where we find a link to that one
data block. I'll talk about data
block links in a moment.
Byte 2 contains the number of THIS
side sector. You can have up to six
side sectors in a relative file.
At 120 data blocks per side sector,
that gives you a data capacity of 720
blocks. Obviously a file that large
would never fit on a 1541 disk with
only 664 blocks available in the first
place.
Byte 3 contains the record size.
This should match the record size
found in the directory entry.
Bytes 4 through 15 contain the
disk addresses of all of the side
sectors for this file. This is the
universal link you saw in the chart
in Part 38.
And now, the bytes you've been
waiting for... the data block links.
Each pair of bytes from 16 to 255
is a data block link. Bytes 16-17
link to block 1. Bytes 18-19 link
to block 2. Etc.
The first link (the one at 16-17)
holds the same value as the data block
link found in the directory entry.
After all, they both point to the
first data block. The second link
has the same value as the file link
at the start of data block 1 -- they
both point to data block 2.
In essence, the data block links
that you find in side sectors are
the spittin' image of the links you
find if you trace through the data
blocks' file links. And that sameness
is what enables DOS to find the data
block it wants quickly via side
sectors.
Now, you know we never give you this
much technical information without
giving you some way to use it, so
we have a little demo program for
you. It is called Q&G UNSCRATCHER and
it is on Side 2 of this issue. This
program is designed to search through
the directory looking for scratched
files. If you would like to unscratch
one of the files, then the program
will attempt to do so. If something
has been saved over any part of the
original file, then the unscratch will
fail and the program will tell you so.
If all of the file can be found and
saved, then the program proceeds to
unscratch the file. To use this
program, you need two files. These
files are:
Q&G UNSCRATCHER
INPUT 1-255.O
First, you will be given a list of all
of the scratched files on the disk.
Then you will be asked for which file
to unscratch. The program will then
search for the name that you input.
The program uses a type of wildcard
when searching the directory. For
example, if you input the name CAT,
then the program will find the first
occurrence of a name with the first
three letters C-A-T. In other words,
the program will find names like
CATALOG, CATS, CATASORIUM, or CATNUM.
Please note that only the first
occurrence will be found and
unscratched.
Press the '\' key to RUN Q&G
\oad "q&g unscratcher",8
UNSCRATCHER now.
=========< end of article >===========